
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>mixins · 合同管理</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Gj">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-tomorrow.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="router.html" />
    
    
    <link rel="prev" href="filters.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    概要
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Framework.html">
            
                <a href="../Framework.html">
            
                    
                    架构
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">src目录</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="api.html">
            
                <a href="api.html">
            
                    
                    api
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="assets.html">
            
                <a href="assets.html">
            
                    
                    assets
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="components.html">
            
                <a href="components.html">
            
                    
                    components
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="filters.html">
            
                <a href="filters.html">
            
                    
                    filters
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="2.5" data-path="mixins.html">
            
                <a href="mixins.html">
            
                    
                    mixins
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="router.html">
            
                <a href="router.html">
            
                    
                    router
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="store.html">
            
                <a href="store.html">
            
                    
                    store
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="styles.html">
            
                <a href="styles.html">
            
                    
                    styles
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="utils.html">
            
                <a href="utils.html">
            
                    
                    utils
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="views/">
            
                <a href="views/">
            
                    
                    views
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.10.1" data-path="views/activate.html">
            
                <a href="views/activate.html">
            
                    
                    activate
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.2" data-path="views/approvemanage.html">
            
                <a href="views/approvemanage.html">
            
                    
                    approvemanage
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.3" data-path="views/sealmanage.html">
            
                <a href="views/sealmanage.html">
            
                    
                    sealmanage
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.4" data-path="views/deptmanage.html">
            
                <a href="views/deptmanage.html">
            
                    
                    deptmanage
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.5" data-path="views/faildoc.html">
            
                <a href="views/faildoc.html">
            
                    
                    faildoc
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.6" data-path="views/files.html">
            
                <a href="views/files.html">
            
                    
                    files
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.7" data-path="views/init.html">
            
                <a href="views/init.html">
            
                    
                    init
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.8" data-path="views/layout.html">
            
                <a href="views/layout.html">
            
                    
                    layout
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.9" data-path="views/login.html">
            
                <a href="views/login.html">
            
                    
                    login
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.10" data-path="views/myfiles.html">
            
                <a href="views/myfiles.html">
            
                    
                    myfiles
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.11" data-path="views/passmail.html">
            
                <a href="views/passmail.html">
            
                    
                    passmail
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.12" data-path="views/redirect.html">
            
                <a href="views/redirect.html">
            
                    
                    redirect
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.13" data-path="views/sysmanage.html">
            
                <a href="views/sysmanage.html">
            
                    
                    sysmanage
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.14" data-path="views/template.html">
            
                <a href="views/template.html">
            
                    
                    template
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.15" data-path="views/updateinfo.html">
            
                <a href="views/updateinfo.html">
            
                    
                    updateinfo
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.10.16" data-path="views/usermanage.html">
            
                <a href="views/usermanage.html">
            
                    
                    usermanage
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="config.html">
            
                <a href="config.html">
            
                    
                    配置文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="newPage.html">
            
                <a href="newPage.html">
            
                    
                    新建页面
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >mixins</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h3 id="&#x591A;&#x7EE7;&#x627F;">&#x591A;&#x7EE7;&#x627F;</h3>
<blockquote>
<p>Vue&#x63D0;&#x4F9B;&#x4E00;&#x5957; &#x5BF9;&#x4E8E; <em>script</em> &#x6807;&#x7B7E;&#x91CC;&#x5B58;&#x5728;&#x91CD;&#x590D;&#x5B9A;&#x4E49;&#x7684; <em>&#x94A9;&#x5B50;&#x51FD;&#x6570;</em>&#x3001;<em>&#x5C5E;&#x6027;</em> &#x7B49;&#xFF0C;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A;&#x62BD;&#x8C61;&#x7684;&#x5B9A;&#x4E49; <em>mixins</em>&#x3002;</p>
<p>&#x7C7B;&#x4F3C;&#x7236;&#x7C7B;&#x3002;&#x5BF9;&#x4E8E;&#x91CD;&#x590D;&#x7684;&#x5B9A;&#x4E49;&#xFF0C;&#x7EDF;&#x4E00;&#x7BA1;&#x7406;&#xFF0C;&#x51CF;&#x5C11;&#x5197;&#x4F59;&#x3002;&#x63D0;&#x9AD8;&#x4EE3;&#x7801;&#x7684;&#x7B80;&#x6D01;&#x6027;&#x548C;&#x53EF;&#x9605;&#x8BFB;&#x6027;&#x3002;</p>
<p><em style="color: #F56C6C">&#x4F7F;&#x7528;mixins&#x5207;&#x8BB0;&#x91CD;&#x540D;&#x60C5;&#x51B5;&#x3002;mixins&#x5728;&#x4E0D;&#x540C;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x91CD;&#x540D;&#x4F1A;&#x51FA;&#x73B0;&#x590D;&#x5199;&#xFF0C;&#x6216;&#x8005;&#x8986;&#x76D6;&#x7684;&#x60C5;&#x51B5;&#xFF0C;&#x5177;&#x4F53;&#x8BE6;&#x60C5;&#xFF0C;&#x53C2;&#x8003;&#x5B98;&#x65B9;&#x6587;&#x6863;</em></p>
</blockquote>
<h5 id="cascaderhandlerjs">cascaderHandler.js</h5>
<p>&#x7531;&#x4E8E;element&#x9ED8;&#x8BA4;&#x7684; <em>&#x7EA7;&#x8054;&#x9009;&#x62E9;&#x5668;</em> &#x4F1A;&#x628A;&#x5168;&#x8DEF;&#x5F84;&#x5C55;&#x793A;&#x51FA;&#x6765;&#x3002;</p>
<p>&#x6B64;&#x529F;&#x80FD;&#x4F18;&#x5316;&#x4E86;&#x7528;&#x6237;&#x64CD;&#x4F5C;&#x3002;&#x8BE5;&#x529F;&#x80FD;&#x9AD8;&#x5EA6;&#x5C01;&#x88C5;&#x3002;&#x5177;&#x4F53;&#x4F7F;&#x7528;&#x7ED3;&#x5408;&#x76EE;&#x524D;&#x6848;&#x4F8B;&#x5373;&#x53EF;&#x3002;</p>
<p><img src="../images/cascaderHandler.jpg" alt=""></p>
<pre class="language-"><code class="lang-typescript"><span class="token keyword">import</span> <span class="token punctuation">{</span> dept_child <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&quot;@/api/operator&quot;</span><span class="token punctuation">;</span>

<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
  <span class="token function">data</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token punctuation">{</span>
      selectData<span class="token operator">:</span> <span class="token punctuation">{</span>
        show<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      props<span class="token operator">:</span> <span class="token punctuation">{</span>
        checkStrictly<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> 
        expandTrigger<span class="token operator">:</span> <span class="token string">&apos;hover&apos;</span><span class="token punctuation">,</span>
        lazy<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
        <span class="token function-variable function">lazyLoad</span> <span class="token operator">:</span> <span class="token keyword">async</span> <span class="token punctuation">(</span><span class="token parameter">node<span class="token punctuation">,</span> resolve</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
          <span class="token keyword">const</span> <span class="token punctuation">{</span> level <span class="token punctuation">}</span> <span class="token operator">=</span> node<span class="token punctuation">;</span>
          <span class="token keyword">let</span> query <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
          <span class="token keyword">if</span><span class="token punctuation">(</span>node<span class="token punctuation">.</span>data<span class="token punctuation">)</span><span class="token punctuation">{</span>
              query<span class="token punctuation">.</span>parentId <span class="token operator">=</span> node<span class="token punctuation">.</span>value<span class="token punctuation">.</span>_id<span class="token punctuation">;</span>
              query<span class="token punctuation">.</span>isLeaf <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
          <span class="token punctuation">}</span>
          <span class="token keyword">let</span> <span class="token punctuation">{</span> data <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">await</span> <span class="token function">dept_child</span><span class="token punctuation">(</span>query<span class="token punctuation">)</span><span class="token punctuation">;</span>
          <span class="token keyword">let</span> nodes <span class="token operator">=</span> data<span class="token punctuation">.</span>data<span class="token punctuation">.</span><span class="token function">map</span><span class="token punctuation">(</span> <span class="token parameter">item</span> <span class="token operator">=&gt;</span> <span class="token punctuation">(</span><span class="token punctuation">{</span>
            value<span class="token operator">:</span> item<span class="token punctuation">,</span>
            label<span class="token operator">:</span> item<span class="token punctuation">.</span>name<span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
          <span class="token function">resolve</span><span class="token punctuation">(</span>nodes<span class="token punctuation">)</span>
        <span class="token punctuation">}</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  methods<span class="token operator">:</span> <span class="token punctuation">{</span>
    <span class="token function">selectDept</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>selectData<span class="token punctuation">.</span>show <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$nextTick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
        document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">&quot;inputId&quot;</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">click</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
      <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">cascaderBlur</span><span class="token punctuation">(</span><span class="token parameter">e</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>selectData<span class="token punctuation">.</span>show <span class="token operator">=</span> e<span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">cascaderChange</span><span class="token punctuation">(</span><span class="token parameter">e</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">let</span> check <span class="token operator">=</span> e<span class="token punctuation">[</span>e<span class="token punctuation">.</span>length <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>form<span class="token punctuation">.</span>deptId <span class="token operator">=</span> check<span class="token punctuation">.</span>_id<span class="token punctuation">;</span>
      <span class="token keyword">this</span><span class="token punctuation">.</span>selectData <span class="token operator">=</span> <span class="token punctuation">{</span>
        show<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
        name<span class="token operator">:</span> check<span class="token punctuation">.</span>name
      <span class="token punctuation">}</span><span class="token punctuation">;</span>
      <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token keyword">typeof</span> <span class="token keyword">this</span><span class="token punctuation">.</span>findUserByDeptId <span class="token operator">==</span> <span class="token string">&apos;function&apos;</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
        <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">findUserByDeptId</span><span class="token punctuation">(</span>check<span class="token punctuation">.</span>_id<span class="token punctuation">)</span><span class="token punctuation">;</span>
      <span class="token punctuation">}</span>
      <span class="token keyword">const</span> panelList <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementsByClassName</span><span class="token punctuation">(</span><span class="token string">&quot;el-cascader__dropdown&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
      <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> panelList<span class="token punctuation">.</span>length<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">const</span> item <span class="token operator">=</span> panelList<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">;</span>
        item<span class="token punctuation">.</span>innerHTML <span class="token operator">=</span> <span class="token string">&apos;&apos;</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<h5 id="filei18nhandlerjs">fileI18nHandler.js</h5>
<p>&#x56FD;&#x9645;&#x5316;mixins</p>
<p>&#x5BF9;&#x4E8E;&#x4E00;&#x4E9B; <em>&#x4E0B;&#x62C9;&#x6846;</em> &#x7B49;&#xFF0C;&#x5728;&#x5207;&#x6362;&#x591A;&#x8BED;&#x8A00;&#x65F6;&#xFF0C;&#x9700;&#x8981;&#x91CD;&#x65B0;&#x6E32;&#x67D3;&#x6570;&#x636E;&#x3002;</p>
<pre class="language-"><code class="lang-javascript"><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
  computed<span class="token operator">:</span> <span class="token punctuation">{</span>
    <span class="token function">contractType</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token comment">//&#x6587;&#x6863;&#x7C7B;&#x522B;</span>
      <span class="token keyword">return</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">&quot;@/views/files/conf&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token string">&apos;contractType&apos;</span> <span class="token operator">+</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$t</span><span class="token punctuation">(</span><span class="token string">&apos;lang.type&apos;</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">childContractType</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token comment">//&#x6587;&#x6863;&#x7C7B;&#x578B;</span>
      <span class="token keyword">return</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">&quot;@/views/files/conf&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token string">&apos;childContractType&apos;</span> <span class="token operator">+</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$t</span><span class="token punctuation">(</span><span class="token string">&apos;lang.type&apos;</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">currencyUnit</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token comment">//&#x8D27;&#x5E01;&#x5355;&#x4F4D;</span>
      <span class="token keyword">return</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">&quot;@/views/files/conf&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token string">&apos;currencyUnit&apos;</span> <span class="token operator">+</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$t</span><span class="token punctuation">(</span><span class="token string">&apos;lang.type&apos;</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">sealTypeList</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token comment">//&#x516C;&#x7AE0;&#x5BF9;&#x8C61;</span>
      <span class="token keyword">return</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">&quot;@/views/files/conf&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token string">&apos;sealTypeList&apos;</span> <span class="token operator">+</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$t</span><span class="token punctuation">(</span><span class="token string">&apos;lang.type&apos;</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">sealTypeArr</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token comment">//&#x516C;&#x7AE0;&#x5217;&#x8868;</span>
      <span class="token keyword">return</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">&quot;@/views/files/conf&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token string">&apos;sealTypeArr&apos;</span> <span class="token operator">+</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$t</span><span class="token punctuation">(</span><span class="token string">&apos;lang.type&apos;</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">documentState</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token comment">//&#x6587;&#x6863;&#x72B6;&#x6001;</span>
      <span class="token keyword">return</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">&quot;@/views/files/conf&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token string">&apos;documentState&apos;</span> <span class="token operator">+</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$t</span><span class="token punctuation">(</span><span class="token string">&apos;lang.type&apos;</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<h5 id="ignitedatahandlerjs">igniteDataHandler.js</h5>
<p>&#x53D1;&#x8D77;&#x5BA1;&#x67E5;&#x65F6;&#xFF0C;&#x5BF9;&#x4E8E;&#x5BA1;&#x67E5;&#x8DEF;&#x5F84;&#x505A;&#x683C;&#x5F0F;&#x5316;</p>
<pre class="language-"><code class="lang-javascript"><span class="token keyword">import</span> <span class="token punctuation">{</span> user_audits <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&apos;@/api/user&apos;</span><span class="token punctuation">;</span>

<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
    methods<span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token keyword">async</span> <span class="token function">getDefaultFormData</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
            <span class="token keyword">const</span> <span class="token function-variable function">fmtPath</span> <span class="token operator">=</span> <span class="token parameter">lines</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
                <span class="token keyword">return</span> lines<span class="token punctuation">.</span><span class="token function">map</span><span class="token punctuation">(</span> <span class="token parameter">item</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
                    <span class="token keyword">let</span> cache <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
                    <span class="token keyword">if</span><span class="token punctuation">(</span>item<span class="token punctuation">.</span>agentUid<span class="token punctuation">)</span><span class="token punctuation">{</span>
                        cache <span class="token operator">=</span> <span class="token punctuation">{</span> resUid<span class="token operator">:</span> item<span class="token punctuation">.</span>agentUid<span class="token punctuation">,</span> resName<span class="token operator">:</span> item<span class="token punctuation">.</span>agentName <span class="token punctuation">}</span>
                    <span class="token punctuation">}</span><span class="token keyword">else</span><span class="token punctuation">{</span>
                        cache <span class="token operator">=</span> <span class="token punctuation">{</span> resUid<span class="token operator">:</span> item<span class="token punctuation">.</span>uid<span class="token punctuation">,</span> resName<span class="token operator">:</span> item<span class="token punctuation">.</span>name <span class="token punctuation">}</span>
                    <span class="token punctuation">}</span>
                    <span class="token keyword">return</span> <span class="token punctuation">{</span><span class="token operator">...</span>cache<span class="token punctuation">,</span> resDeptId<span class="token operator">:</span> item<span class="token punctuation">.</span>deptId<span class="token punctuation">,</span> resOptType<span class="token operator">:</span> item<span class="token punctuation">.</span>resOptType <span class="token punctuation">}</span>
                <span class="token punctuation">}</span><span class="token punctuation">)</span>
            <span class="token punctuation">}</span>
            <span class="token keyword">const</span> <span class="token punctuation">{</span> auditLines<span class="token punctuation">,</span> sealLines<span class="token punctuation">,</span> keepLines<span class="token punctuation">,</span> directLines <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>approveLines<span class="token punctuation">;</span>
            <span class="token keyword">let</span> auditList <span class="token operator">=</span> <span class="token function">fmtPath</span><span class="token punctuation">(</span>auditLines<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">let</span> sealList <span class="token operator">=</span> <span class="token function">fmtPath</span><span class="token punctuation">(</span>sealLines<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">let</span> keepList <span class="token operator">=</span> <span class="token function">fmtPath</span><span class="token punctuation">(</span>keepLines<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">let</span> directList <span class="token operator">=</span> directLines <span class="token operator">?</span> <span class="token function">fmtPath</span><span class="token punctuation">(</span>directLines<span class="token punctuation">)</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>

            <span class="token keyword">let</span> paths <span class="token operator">=</span> auditList<span class="token punctuation">.</span><span class="token function">concat</span><span class="token punctuation">(</span>sealList<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">concat</span><span class="token punctuation">(</span>keepList<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">concat</span><span class="token punctuation">(</span>directList<span class="token punctuation">)</span><span class="token punctuation">;</span>

            <span class="token keyword">const</span> <span class="token punctuation">{</span> _id<span class="token punctuation">,</span> name<span class="token punctuation">,</span> deptId <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>user<span class="token punctuation">;</span>
            <span class="token keyword">let</span> data <span class="token operator">=</span> <span class="token punctuation">{</span>
                reqUid<span class="token operator">:</span> _id<span class="token punctuation">,</span>
                reqName<span class="token operator">:</span> name<span class="token punctuation">,</span>
                reqDeptId<span class="token operator">:</span> deptId<span class="token punctuation">,</span>
                reqDeptName<span class="token operator">:</span> localStorage<span class="token punctuation">.</span><span class="token function">getItem</span><span class="token punctuation">(</span><span class="token string">&quot;deptName&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
                emergency<span class="token operator">:</span> <span class="token keyword">this</span><span class="token punctuation">.</span>form<span class="token punctuation">.</span>emergency<span class="token punctuation">,</span>
                deadline<span class="token operator">:</span> <span class="token keyword">this</span><span class="token punctuation">.</span>form<span class="token punctuation">.</span>date<span class="token punctuation">,</span>
                paths
            <span class="token punctuation">}</span>
            <span class="token keyword">return</span> data<span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token keyword">async</span> <span class="token function">getDefaultAudits</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
            <span class="token keyword">const</span> <span class="token punctuation">{</span> auditLines <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>approveLines<span class="token punctuation">;</span>
            <span class="token keyword">let</span> form <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> auditLines<span class="token punctuation">.</span>length<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token keyword">const</span> audit <span class="token operator">=</span> auditLines<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">;</span>
                form<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">=</span> audit<span class="token punctuation">.</span>agentUid <span class="token operator">||</span> audit<span class="token punctuation">.</span>uid
            <span class="token punctuation">}</span>
            <span class="token keyword">return</span> form<span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token keyword">async</span> <span class="token function">getAuditList</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
            <span class="token keyword">const</span> <span class="token punctuation">{</span> auditLines <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>approveLines<span class="token punctuation">;</span>
            <span class="token keyword">let</span> arr <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
            <span class="token keyword">try</span> <span class="token punctuation">{</span>
                <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> auditLines<span class="token punctuation">.</span>length<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                    <span class="token keyword">const</span> <span class="token punctuation">{</span> level <span class="token punctuation">}</span> <span class="token operator">=</span> auditLines<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">;</span>
                    <span class="token keyword">const</span> <span class="token punctuation">{</span> data <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">await</span> <span class="token function">user_audits</span><span class="token punctuation">(</span><span class="token punctuation">{</span>level<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token keyword">if</span><span class="token punctuation">(</span>data<span class="token punctuation">.</span>errorCode <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
                        arr<span class="token punctuation">[</span>i<span class="token punctuation">]</span> <span class="token operator">=</span> data<span class="token punctuation">.</span>data<span class="token punctuation">;</span>
                    <span class="token punctuation">}</span>
                <span class="token punctuation">}</span>
                <span class="token keyword">return</span> arr<span class="token punctuation">;</span>
            <span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span>error<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token keyword">return</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<h5 id="toolbarauthhandlerjs">toolBarAuthHandler.js</h5>
<p>&#x5224;&#x65AD;&#x767B;&#x5F55;&#x7528;&#x6237;&#x662F;&#x5426; &#x662F;&#x7BA1;&#x7406;&#x5458;</p>
<pre class="language-"><code class="lang-javascript">
<span class="token keyword">import</span> <span class="token punctuation">{</span> mapGetters <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&quot;vuex&quot;</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> UserRole <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&apos;@/utils/Enum/FEnum&apos;</span><span class="token punctuation">;</span>

<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
    computed<span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token operator">...</span><span class="token function">mapGetters</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">&quot;user&quot;</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        <span class="token function">isOnlyWatch</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
            <span class="token comment">/* 
                thinking&#xFF1A;
                &#x5982;&#x679C;&#x7528;&#x6237;
                    &#x4E0D;&#x4E3A;&#x7BA1;&#x7406;&#x5458;
                    &#x4E14;user.roles.length == 1
                    &#x4E14;roles[0] == 0 //&#x666E;&#x901A;&#x7528;&#x6237;
            */</span>
            <span class="token keyword">const</span> <span class="token punctuation">{</span> isAdmin<span class="token punctuation">,</span> roles <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>user<span class="token punctuation">;</span>
            <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>isAdmin <span class="token operator">&amp;&amp;</span> roles<span class="token punctuation">.</span>length <span class="token operator">==</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
                <span class="token keyword">return</span> <span class="token operator">!</span><span class="token punctuation">(</span>roles<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">==</span> UserRole<span class="token punctuation">.</span>normal<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token keyword">return</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span>
</code></pre>
<h5 id="uploadhandlerjs">uploadHandler.js</h5>
<p>&#x9644;&#x4EF6;&#x4E0A;&#x4F20;&#xFF0C;&#x683C;&#x5F0F;&#x6821;&#x9A8C;</p>
<pre class="language-"><code class="lang-javascript"><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
  methods<span class="token operator">:</span> <span class="token punctuation">{</span>
    <span class="token function">beforeUpload</span><span class="token punctuation">(</span><span class="token parameter"><span class="token punctuation">{</span>size<span class="token punctuation">,</span> name<span class="token punctuation">}</span></span><span class="token punctuation">)</span><span class="token punctuation">{</span>
      <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token keyword">this</span><span class="token punctuation">.</span>form<span class="token punctuation">.</span>category<span class="token punctuation">)</span><span class="token punctuation">{</span>
          <span class="token keyword">this</span><span class="token punctuation">.</span>$message<span class="token punctuation">.</span><span class="token function">warning</span><span class="token punctuation">(</span><span class="token string">&quot;&#x8BF7;&#x5148;&#x9009;&#x62E9;&#x6587;&#x6863;&#x7C7B;&#x522B;&quot;</span><span class="token punctuation">)</span>
          <span class="token keyword">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
      <span class="token punctuation">}</span>
      <span class="token keyword">var</span> index <span class="token operator">=</span> name<span class="token punctuation">.</span><span class="token function">lastIndexOf</span><span class="token punctuation">(</span><span class="token string">&quot;.&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
      <span class="token keyword">if</span><span class="token punctuation">(</span>index <span class="token operator">==</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
          <span class="token keyword">this</span><span class="token punctuation">.</span>$message<span class="token punctuation">.</span><span class="token function">warning</span><span class="token punctuation">(</span><span class="token string">&quot;&#x8BF7;&#x4E0A;&#x4F20;&#x6B63;&#x786E;&#x7684;&#x6587;&#x6863;&#x683C;&#x5F0F;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
          <span class="token keyword">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
      <span class="token punctuation">}</span>
      <span class="token keyword">var</span> ext <span class="token operator">=</span> name<span class="token punctuation">.</span><span class="token function">substr</span><span class="token punctuation">(</span>index<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
      <span class="token keyword">const</span> cache <span class="token operator">=</span> <span class="token punctuation">[</span>
          <span class="token string">&quot;doc&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;docx&quot;</span><span class="token punctuation">,</span> 
          <span class="token string">&quot;xlsx&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;xls&quot;</span><span class="token punctuation">,</span>
          <span class="token string">&apos;txt&apos;</span><span class="token punctuation">,</span> <span class="token string">&apos;TXT&apos;</span><span class="token punctuation">,</span> 
          <span class="token string">&apos;pdf&apos;</span><span class="token punctuation">,</span> <span class="token string">&apos;PDF&apos;</span><span class="token punctuation">,</span> 
          <span class="token string">&apos;ppt&apos;</span><span class="token punctuation">,</span> <span class="token string">&apos;pptx&apos;</span><span class="token punctuation">,</span> 
          <span class="token string">&apos;pptm&apos;</span><span class="token punctuation">,</span> <span class="token string">&apos;csv&apos;</span><span class="token punctuation">,</span> 
          <span class="token string">&apos;zip&apos;</span>
          <span class="token punctuation">]</span><span class="token punctuation">;</span>
      <span class="token keyword">if</span><span class="token punctuation">(</span>cache<span class="token punctuation">.</span><span class="token function">indexOf</span><span class="token punctuation">(</span>ext<span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
          <span class="token keyword">this</span><span class="token punctuation">.</span>$message<span class="token punctuation">.</span><span class="token function">warning</span><span class="token punctuation">(</span><span class="token string">&quot;&#x8BF7;&#x4E0A;&#x4F20;&#x6B63;&#x786E;&#x7684;&#x6587;&#x6863;&#x683C;&#x5F0F;&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
          <span class="token keyword">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
      <span class="token punctuation">}</span>
      <span class="token keyword">if</span><span class="token punctuation">(</span>size <span class="token operator">/</span> <span class="token number">1024</span> <span class="token operator">&gt;</span> <span class="token number">10240</span><span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token comment">//10240 = 10M </span>
        <span class="token keyword">this</span><span class="token punctuation">.</span>$message<span class="token punctuation">.</span><span class="token function">warning</span><span class="token punctuation">(</span><span class="token string">&apos;&#x6587;&#x4EF6;&#x4E0D;&#x80FD;&#x5927;&#x4E8E;10M&apos;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<h5 id="userrolehandlerjs">userRoleHandler.js</h5>
<p>&#x7528;&#x6237;&#x89D2;&#x8272;&#x64CD;&#x4F5C;&#x76F8;&#x5173;mixin</p>
<pre class="language-"><code class="lang-javascript">
<span class="token keyword">import</span> <span class="token punctuation">{</span> mapGetters <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">&quot;vuex&quot;</span><span class="token punctuation">;</span>

<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
    watch<span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token comment">//&#x76D1;&#x542C; &#x56FD;&#x9645;&#x5316;</span>
        <span class="token function">powerList</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">let</span> roleCache <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
            <span class="token keyword">this</span><span class="token punctuation">.</span>defRoles<span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
                <span class="token keyword">this</span><span class="token punctuation">.</span>roleList<span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span><span class="token parameter">el</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
                    <span class="token keyword">if</span> <span class="token punctuation">(</span>item<span class="token punctuation">.</span>id <span class="token operator">==</span> el<span class="token punctuation">.</span>id<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                        roleCache<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span>el<span class="token punctuation">)</span>
                    <span class="token punctuation">}</span>
                <span class="token punctuation">}</span><span class="token punctuation">)</span>
            <span class="token punctuation">}</span><span class="token punctuation">)</span>
            <span class="token keyword">this</span><span class="token punctuation">.</span>defRoles <span class="token operator">=</span> roleCache<span class="token punctuation">;</span>
            <span class="token keyword">let</span> powerCache <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
            <span class="token keyword">this</span><span class="token punctuation">.</span>defPowerList<span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
                Object<span class="token punctuation">.</span><span class="token function">values</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>powerList<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span><span class="token parameter">el</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
                    <span class="token keyword">if</span> <span class="token punctuation">(</span>item<span class="token punctuation">.</span>id <span class="token operator">==</span> el<span class="token punctuation">.</span>id<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                        powerCache<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span>el<span class="token punctuation">)</span>
                    <span class="token punctuation">}</span>
                <span class="token punctuation">}</span><span class="token punctuation">)</span>
            <span class="token punctuation">}</span><span class="token punctuation">)</span>
            <span class="token keyword">this</span><span class="token punctuation">.</span>defPowerList <span class="token operator">=</span> powerCache<span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    computed<span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token operator">...</span><span class="token function">mapGetters</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">&quot;queryParams&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;user&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;urlQuery&quot;</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        <span class="token function">roleList</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">return</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">&quot;@/views/usermanage/temp/conf&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token string">&apos;roleList&apos;</span> <span class="token operator">+</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$t</span><span class="token punctuation">(</span><span class="token string">&apos;lang.type&apos;</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token function">powerList</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">return</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">&quot;@/views/usermanage/temp/conf&quot;</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token string">&apos;powerList&apos;</span> <span class="token operator">+</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$t</span><span class="token punctuation">(</span><span class="token string">&apos;lang.type&apos;</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    methods<span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token function">checkBox</span><span class="token punctuation">(</span><span class="token parameter">e<span class="token punctuation">,</span> bool</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token comment">/** &#x6392;&#x4ED6;&#xFF08;&#x4E00;&#x822C;&#x5458;&#x5DE5;&#xFF09; */</span>
            <span class="token keyword">if</span> <span class="token punctuation">(</span>e<span class="token punctuation">.</span>id <span class="token operator">==</span> <span class="token number">0</span> <span class="token operator">&amp;&amp;</span> bool<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token keyword">this</span><span class="token punctuation">.</span>defPowerList <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>powerList<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
                <span class="token keyword">this</span><span class="token punctuation">.</span>defRoles <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token keyword">this</span><span class="token punctuation">.</span>roleList<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
                <span class="token keyword">let</span> list <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
                <span class="token keyword">this</span><span class="token punctuation">.</span>defRoles<span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
                    <span class="token keyword">if</span> <span class="token punctuation">(</span>item<span class="token punctuation">.</span>id <span class="token operator">!=</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                        list<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span>item<span class="token punctuation">)</span><span class="token punctuation">;</span>
                    <span class="token punctuation">}</span>
                <span class="token punctuation">}</span><span class="token punctuation">)</span>
                <span class="token keyword">this</span><span class="token punctuation">.</span>defRoles <span class="token operator">=</span> list<span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token function">checkBoxHandler</span><span class="token punctuation">(</span><span class="token parameter">e</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">this</span><span class="token punctuation">.</span>form<span class="token punctuation">.</span>isAdmin <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
            <span class="token keyword">let</span> <span class="token keyword">set</span> <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Set</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">let</span> list <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
            e<span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
                <span class="token keyword">if</span> <span class="token punctuation">(</span>item<span class="token punctuation">.</span>isAdmin<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                    <span class="token keyword">this</span><span class="token punctuation">.</span>form<span class="token punctuation">.</span>isAdmin <span class="token operator">=</span> <span class="token boolean">true</span>
                <span class="token punctuation">}</span>
                item<span class="token punctuation">.</span>power<span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span><span class="token parameter">id</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
                    <span class="token keyword">set</span><span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>id<span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">const</span> id <span class="token keyword">of</span> <span class="token keyword">set</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                list<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>powerList<span class="token punctuation">[</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token keyword">this</span><span class="token punctuation">.</span>defPowerList <span class="token operator">=</span> list<span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token keyword">async</span> <span class="token function">validate</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token keyword">this</span><span class="token punctuation">.</span>$refs<span class="token punctuation">.</span>form<span class="token punctuation">.</span><span class="token function">validate</span><span class="token punctuation">(</span><span class="token parameter">valid</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
                <span class="token keyword">if</span> <span class="token punctuation">(</span>valid<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                    <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>defRoles<span class="token punctuation">.</span>length <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                        <span class="token keyword">this</span><span class="token punctuation">.</span>$message<span class="token punctuation">.</span><span class="token function">warning</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$t</span><span class="token punctuation">(</span><span class="token string">&quot;usermanage.temp.msg.norole&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        <span class="token keyword">return</span><span class="token punctuation">;</span>
                    <span class="token punctuation">}</span>
                    <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span><span class="token keyword">this</span><span class="token punctuation">.</span>form<span class="token punctuation">.</span>deptId<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                        <span class="token keyword">this</span><span class="token punctuation">.</span>$message<span class="token punctuation">.</span><span class="token function">warning</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$t</span><span class="token punctuation">(</span><span class="token string">&quot;usermanage.temp.msg.nodept&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                        <span class="token keyword">return</span><span class="token punctuation">;</span>
                    <span class="token punctuation">}</span>
                    <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">submit</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span>
            <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="filters.html" class="navigation navigation-prev " aria-label="Previous page: filters">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="router.html" class="navigation navigation-next " aria-label="Next page: router">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"mixins","level":"2.5","depth":1,"next":{"title":"router","level":"2.6","depth":1,"path":"src/router.md","ref":"src/router.md","articles":[]},"previous":{"title":"filters","level":"2.4","depth":1,"path":"src/filters.md","ref":"src/filters.md","articles":[]},"dir":"ltr"},"config":{"plugins":["chapter-fold","-lunr","-search","search-pro","-highlight","prism"],"styles":{"website":"styles/website.css"},"pluginsConfig":{"prism":{"css":["prismjs/themes/prism-tomorrow.css"]},"chapter-fold":{},"search-pro":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Gj","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"合同管理","language":"zh-hans","gitbook":"3.2.3","description":"合同管理Web端"},"file":{"path":"src/mixins.md","mtime":"2020-02-24T03:16:58.849Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-03-07T04:19:36.591Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

